import { observable, action } from 'mobx';
import {WeaForm} from 'comsMobx'
import * as Apis from "../apis/instock"
import cptInstockStore from './instockStore'

class InventoryRemindStore {
    @observable instockStore = cptInstockStore;
    @observable info = [];
    @observable form = new WeaForm();

    @action 
    getRemindInfo = (params)=>{
        const that = this ; 
        Apis.getRemindInfo(params).then(data=>{
            that.info = data.tableinfo;
            that.instockStore.initDatas(data.data);
            that.form && !that.form.isFormInit && that.form.initFormFields(data.tableinfo);
        })
    }

    setVisible = (flag)=>{
        this.instockStore.visible = flag;
    }
    
}

const inventoryRemindStore = new InventoryRemindStore();
export default inventoryRemindStore;